package com.analyze.po;

import org.json.JSONException;
import org.json.JSONObject;

import jofc2.model.Chart;
import jofc2.model.Text;

import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.json.JettisonMappedXmlDriver;


public class ChartTemplet {
	public static void main(String[] args) throws JSONException{
		Chart chart = new Chart();
		Text title = new Text();
		title.setText("test");
		chart.setTitle(title);
		String value = chart.toString();
		XStream st = new XStream(new JettisonMappedXmlDriver());
//		String value = st.toXML(chart);
		System.out.println(value);
		JSONObject obj = new JSONObject(value).getJSONObject(Chart.class.getName());
		st.alias("title", Chart.class);

		
		System.out.println(obj.getClass());
//		System.out.println(chart.toString());
	}
}
